<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<link href="lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>打款</title>
</head>
<body>
<div class="pd-20">
	<form action="<%=path%>/backstage/payMoney" method="post" class="form form-horizontal" id="apply">
        <div class="row cl">
			<label class="form-label col-2">商家名称：</label>
            <div class="formControls col-4">
            	<label id="c_sname"></label>
        	</div>
        </div>
        <div class="row cl">
        	<label class="form-label col-2">所属站点：</label>
            <div class="formControls col-4">
            	<label id="cityName"></label>
        	</div>
        </div>
        <div class="row cl">
        	<label class="form-label col-2">商家银行帐号：</label>
            <div class="formControls col-4">
            	<label id="bank_no"></label>
                <input type="hidden" id="bank_no_input" name="bank_num" >
        	</div>
        </div>
       <div class="row cl">
        	<label class="form-label col-2">开户行：</label>
            <div class="formControls col-4">
            	<label id="bank_name"></label>
                <input type="hidden" id="bank_name_input" name="bank_name" value="${shop.bankname}">
        	</div>
        </div>
        <div class="row cl">
        	<label class="form-label col-2">申请人：</label>
            <div class="formControls col-4">
            	<label id="bd_user"></label>
        	</div>
        </div>
      <div class="row cl">
			<label class="form-label col-2">申请金额：</label>
            <div class="formControls col-4">
            	<label id="money"></label>
        	</div>
       </div>
        
        <div class="row cl">
			<label class="form-label col-2">打款金额：</label>
            <div class="formControls col-4">
            	<input type="hidden" id="shopid" name="shopid">
            	<input type="hidden" id="applyid" name="applyid">
                <input type="text" class="input-text" value="" placeholder="" id="mon" name="money" >
        	</div>
		</div>
		
		<div class="row cl">
			<div class="col-10 col-offset-2">
				<button onClick="apply_submit();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
				<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.1/layer.js"></script> 
<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script> 
<script type="text/javascript" src="lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="lib/Validform/5.3.2/Validform.min.js"></script> 
<script type="text/javascript" src="lib/webuploader/0.1.5/webuploader.min.js"></script> 
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
<script type="text/javascript" src="lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="js/H-ui.js"></script> 
<script type="text/javascript" src="js/H-ui.admin.js"></script> 
<script type="text/javascript">
$(function(){
	var applyId = parent.$("#applyid").val();
	$("#applyid").val(applyId);
	$("#shopid").val(parent.$("#shopid").val());
	$("#money").text(parent.$("#money").val());
	$("#c_sname").text(parent.$("#"+applyId + " td[data-name='c_sname']").text());
	$("#cityName").text(parent.$("#"+applyId + " td[data-name='cityName']").text());
	$("#bank_name").text(parent.$("#"+applyId + " td[data-name='bank_name']").text());
	$("#bank_no").text(parent.$("#"+applyId + " td[data-name='bank_no']").text());
	$("#bd_user").text(parent.$("#"+applyId + " td[data-name='bd_user']").text());

	$("#bank_name_input").val(parent.$("#"+applyId + " td[data-name='bank_name']").text());
	$("#bank_no_input").val(parent.$("#"+applyId + " td[data-name='bank_no']").text());
})
function apply_submit(){
	$("#apply").Validform({
		tiptype:2,
		ajaxPost:true,
		beforeSubmit:function(){
			if(fmoney($("#money").text(),2)!=fmoney($("#mon").val(),2)){
				layer.msg('请输入正确金额', {time:1000,icon: 5});  
				return false;
			}
		},
		callback:function(form){
			var index = parent.layer.getFrameIndex(window.name);
			if (index){//关闭弹出层
				parent.$('.btn-refresh').click(); 
				parent.layer.close(index);
			}
		}
	});
}
//格式化价钱
function fmoney(s, n) { 
	n = n > 0 && n <= 20 ? n : 2; 
	s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + ""; 
	var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1]; 
	t = ""; 
	for (i = 0; i < l.length; i++) { 
	t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : ""); 
	} 
	return t.split("").reverse().join("") + "." + r; 
}

</script>
</body>
</html>

